import store from 'store';
export default {
    paging:{
        url:'api/getApiList.do',
        ajax:{
            type:'POST'
        },
        pCount:10
    },
    dataField:'apiList',
    columns:[{
        width:'7%',
        title:'状态',
        field:'state',
        showtitle:false,
        nowrap:false,            
        filter(val,field){
            field = field+'api';
            return store(field)[val]
        }
    },{
        width:'10%',
        title:'接口名称',
        field:'apiName',
        nowrap:true,
        template:true,
        filter:null,
        content:`
        <a href="#!/platform/apidetail/<%$value.id%>" class="f-cblue"><%$value.apiName%></a>
        `
    },{
        width:'14%',
        title:'接口描述',
        field:'apiDesc',
        nowrap:false,
        className:'f-toeup'
    },{
        width:'7%',
        title:'业务大类',
        field:'bigClass',
        nowrap:false
    },{
        width:'8%',
        title:'业务小类',
        field:'smallClass',
        nowrap:false
    },{
        width:'6%',
        title:'版本号',
        field:'version',
        nowrap:false
    },{
        width:'7%',
        title:'流量限额',
        field:'flowLimit',
        nowrap:false
    },{
        width:'7%',
        title:'收费模式',
        field:'isFree',
        nowrap:false,
        filter(val,field){
            return store(field)[val]
        }
    },{
        width:'6%',
        title:'操作人',
        field:'operator',
        nowrap:false
    },{
        width:'9%',
        title:'修改时间',
        field:'updateTime',
        nowrap:false
    },{
        width:'9%',
        title:'创建时间',
        field:'createTime',
        nowrap:false
    },{
        title:'操作',
        nowrap:false,
        filter:null,
        template:true,
        content:`
        <div class="m-operation">
        <%if $value.state == '4'%>
            <a href="javascript:void(0)" class="j-edit f-cblue">修改</a>
        <%elseif $value.state == '0'%>
            <span class="m-hint f-dn">
                <div class="pre pre1"></div>
                <div class="pre pre2"></div>
                <div class="m-hintCont">
                    <p>您无下线权限，</p>
                    <p>请联系开放平台管理员</p>
                </div>
            </span>
            <a href="javascript:void(0)" data-id="<%$value.id%>" class="j-downline f-cblue">下线</a>
            <a href="/InterfacePlatform/api/exportSQL.do?apiId=<% $value.id %>&amp;state=<% $value.state %>" class="j-export f-cblue">导出SQL</a>
        <%/if%>
        </div>
        `
    }]
}